<template>
    <div>
        <h1>权益添加页面</h1>
        <table class="table table-bordered">
            <tbody>
                <tr>
                    <td align="right">权益名称</td>
                    <td>
                        <input type="text" v-model="queryInfo.Name">
                    </td>
                </tr>
                <tr>
                    <td align="right">权益状态</td>
                    <td>
                       <input type="radio" name="state" :value="1" v-model="queryInfo.State"/>是
                       <input type="radio" name="state" :value="0" v-model="queryInfo.State"/>否

                    </td>
                </tr>
                <tr>
                    <td align="right">权益备注</td>
                    <td>
                        <textarea cols="50" rows="5" v-model="queryInfo.Desc"></textarea>
                        
                    </td>
                </tr>
                <tr>
                    <td align="right"></td>
                    <td>
                        <input type="button" class="btn btn-success" value="增加" @click="add">
                    </td>
                </tr>
            </tbody>
        </table>
        
    </div>
</template>

<script setup lang="ts">
import { ref,reactive,onMounted } from 'vue';
import { useRoute,useRouter } from 'vue-router';
import axios from 'axios';
let router=useRouter();
let queryInfo=reactive({
  Name: '',
  State: 1,
  Desc: '',
});
const add=()=>{
    axios({
        url:'api/ZMember/AddUserRight',
        method:'post',
        data:queryInfo
    })
    .then((res)=>{
        console.log(res);
        if(res.data>0){
            alert("成功!");
            router.push("/userright")
        }
    })
    .catch((err)=>{
        console.log(err);
    })
}
</script>

<style scoped>

</style>